<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	template="/WEB-INF/template/template2.xhtml">

	<ui:define name="content1">


		

		<h:form id="houseForm">
		<p:growl id="messages" showDetail="true" />

			<div class="container">



				<p:accordionPanel multiple="true" style="width:auto !important">

					<p:tab title="General information">
						<h:panelGrid class="table" columns="2" cellpadding="10">
					
							
							
							<h:outputText value="House name"/>
							<p:inputText value="#{houseBean.newHouse.houseName}" />
						</h:panelGrid>
					</p:tab>

					<p:tab title="Address">
						<h:panelGrid class="table" columns="2" cellpadding="10">
							<h:outputLabel>Address</h:outputLabel>
							<p:inputText value="#{houseBean.newHouse.address}" />

							<h:outputLabel>Postal code</h:outputLabel>
							<p:inputText value="#{houseBean.newHouse.postalCode}" />
						</h:panelGrid>
					</p:tab>

					<p:tab title="Location">


						<h:panelGrid class="table" columns="2" cellpadding="10">
							<p:gmap id="gmap" type="HYBRID" zoom="15"
								center="46.757213, 23.588145" style="width:380px;height:300px"
								model="#{houseBean.newModel}"
								onPointClick="handlePointClick(event)" widgetVar="map" />
						</h:panelGrid>
					</p:tab>
					
					<p:tab title="Finish">


						<h:panelGrid class="table" columns="1" cellpadding="10">
							<p:commandButton value="Create house" action="#{houseBean.createHouse}" ajax="false">
							<p:ajax execute="@all" render="@form"/>
							</p:commandButton>
						</h:panelGrid>
					</p:tab>
				</p:accordionPanel>



			</div>

		</h:form>
		<p:dialog widgetVar="dlg" effect="FADE" effectDuration="0.5"
			close="false" fixedCenter="true">
			<h:form prependId="false">
				<h:panelGrid columns="2">
					<h:outputLabel for="title" value="Title:" />
					<p:inputText id="title" value="#{houseBean.title}" />

					<f:facet name="footer">
						<p:commandButton value="Add"
							actionListener="#{houseBean.addMarker}" update=":houseForm:messages"
							oncomplete="markerAddComplete()" />
						<p:commandButton value="Cancel" onclick="return cancel()" />
					</f:facet>
				</h:panelGrid>

				<h:inputHidden id="lat" value="#{houseBean.lat}" />
				<h:inputHidden id="lng" value="#{houseBean.lng}" />
			</h:form>
		</p:dialog>
	</ui:define>

</ui:composition>
